package cn.jingyuan.swan.system.web.controller.sys;

import cn.jingyuan.swan.cloud.core.Result;
import cn.jingyuan.swan.cloud.core.ResultUtils;
import cn.jingyuan.swan.system.model.dto.AuthorityResourceDto;
import cn.jingyuan.swan.system.service.AuthorityService;
import cn.jingyuan.swan.system.web.restful.AuthorityRestful;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "权限  Api 接口")
@Slf4j
@RestController
public class AuthorityController implements AuthorityRestful {

    @Resource
    AuthorityService authorityService;

    @ApiOperation(value = "获取全部访问权限列表 ", notes = "获取全部访问权限列表")
    @Override
    public Result<List<AuthorityResourceDto>> findAuthorityResource() {
        List<AuthorityResourceDto> resource = authorityService.findAuthorityResource();
        return ResultUtils.ok(resource);
    }

}
